/***********************************************************************
	filename: 	DaterRecover.h
	created:	22/4/2012
	author:		4Ys
	
	purpose:	Defines a virtual class to recover an event by orders 
				from client to server
*************************************************************************/
#ifndef _DaterRecover_h_
#define _DaterRecover_h_

#include <string>
#include <vector>

namespace Dater
{
	class Recover
	{
	public:
		/*!
		 \brief
			 Construct class Recover with a param.

		 \param splitedVector
		     - a vector of string of orders from server to client.
		*/
		Recover(std::string recvMessage);

		std::string getType();

		std::string getErrorMsg();

		//virtual int judge(const char* order) = 0;

	protected:
		/*!
		 a string of order from server to client.
		*/
		std::string _order;

		/*!
		 a string which is the charactor to split the order.
		*/
		std::string _delimiter;

		/*!
		 a vector of strings which are tiny orders.
		*/
		std::vector<std::string> _splitedData;

		/*!
		 \brief
			 A processing function to split the order.

		 \param order
		     - a string of order from client to server.

		 \param delimiter
		     - a string which is the charactor to split the order.

		 \param splitedVector
		     - a vector of strings which are tiny orders splited from order.

		 \return
			 Nothing.
		*/
		void split(std::string const& order, std::string delimiter, std::vector<std::string>& splitedVector);

		std::string _type;

		std::string _errorMsg;

	private:
		/*!
		 \brief
			 Construct class Translator.
		*/
		Recover(){};
	};
}
#endif